package com.xnyzc.lhy.common.penum.order;

/**
 * 更改订单费用类型
 */
public enum EUpdateOrderFeeType {
    //"0 - 起步价 1 - 里程费 2 - 时长费 3 - 远途费 4 - 路桥费 5 - 停车费 6 - 高速费 7 - 其他费用
    startFee(0, "起步价"),
    mileageFee(1, "里程费"),
    timeFee(2, "时长费"),
    distanceFee(3, "远途费"),
    bridgeFee(4, "过桥费"),
    parkingFee(5, "停车费"),
    highSpeedFee(6, "高速费"),
    otherFee(7, "其他费用"),
    totalFee(8, "总费用");

    private Integer type;
    private String desc;

    EUpdateOrderFeeType(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    /**
     * 根据type获取要更改的枚举类型
     *
     * @param type
     * @return
     */
    public static EUpdateOrderFeeType findByType(Integer type) {
        EUpdateOrderFeeType[] values = values();
        for (EUpdateOrderFeeType value : values) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }

    public Integer getType() {
        return type;
    }

    public String getDesc() {
        return desc;
    }

}
